import { request } from '@/utils/request.js'

/**
 * 轮播图 API JS
 */

export default {

  /**
   * 获取轮播图分页列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'kuaili/banner/index',
      method: 'get',
      params
    })
  },

  /**
   * 添加轮播图
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'kuaili/banner/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新轮播图数据
   * @returns
   */
  update (id, data = {}) {
    return request({
      url: 'kuaili/banner/update/' + id,
      method: 'put',
      data
    })
  },

  /**
   * 读取轮播图
   * @returns
   */
  read (id) {
    return request({
      url: 'kuaili/banner/read/' + id,
      method: 'get',
      data
    })
  },

  /**
   * 将轮播图删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'kuaili/banner/delete',
      method: 'delete',
      data
    })
  },

  /**
   * 从回收站获取轮播图数据列表
   * @returns
   */
  getRecycleList (params = {}) {
    return request({
      url: 'kuaili/banner/recycle',
      method: 'get',
      params
    })
  },

  /**
   * 恢复轮播图数据
   * @returns
   */
  recoverys (data) {
    return request({
      url: 'kuaili/banner/recovery',
      method: 'put',
      data
    })
  },

  /**
   * 真实删除轮播图
   * @returns
   */
  realDeletes (data) {
    return request({
      url: 'kuaili/banner/realDelete',
      method: 'delete',
      data
    })
  },

  /**
   * 更改轮播图数据
   * @returns
   */
  changeStatus (data = {}) {
    return request({
      url: 'kuaili/banner/changeStatus',
      method: 'put',
      data
    })
  },

  /**
   * 修改轮播图数值数据，自增自减
   * @returns
   */
  numberOperation (data = {}) {
    return request({
      url: 'kuaili/banner/numberOperation',
      method: 'put',
      data
    })
  },


}